package com.lzy.huijinjiazu.mvp.presenter;

import android.app.Application;
import android.support.v4.app.Fragment;

import com.jess.arms.integration.AppManager;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.http.imageloader.ImageLoader;

import me.jessyan.rxerrorhandler.core.RxErrorHandler;

import javax.inject.Inject;

import com.lzy.huijinjiazu.mvp.contract.MallCollectContract;


@ActivityScope
public class MallCollectPresenter extends BasePresenter<MallCollectContract.Model, MallCollectContract.View> {
    private RxErrorHandler mErrorHandler;
    private Application mApplication;
    private ImageLoader mImageLoader;
    private AppManager mAppManager;

    @Inject
    public MallCollectPresenter(MallCollectContract.Model model, MallCollectContract.View rootView
            , RxErrorHandler handler, Application application
            , ImageLoader imageLoader, AppManager appManager) {
        super(model, rootView);
        this.mErrorHandler = handler;
        this.mApplication = application;
        this.mImageLoader = imageLoader;
        this.mAppManager = appManager;
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.mErrorHandler = null;
        this.mAppManager = null;
        this.mImageLoader = null;
        this.mApplication = null;
    }
    public void initTabLayout() {
        String[] title = mModel.getTitle();
        Fragment[] tabFragment = mModel.getTabFragment(title);
        mRootView.showTabLayout(title, tabFragment);
    }
}
